package cn.iocoder.yudao.module.reading.controller.app.classes.vo;

import cn.iocoder.yudao.module.reading.framework.vo.BaseUrlConvertVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 班级成员信息 Response VO
 *
 * @author 芋道源码
 */
@Schema(description = "用户 APP - 班级成员信息 Response VO")
@Data
@EqualsAndHashCode(callSuper = false)
public class ClassMemberRespVO extends BaseUrlConvertVO {

    @Schema(description = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Long userId;

    @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "小明")
    private String nickname;

    @Schema(description = "用户头像", example = "/static/avatars/boy1.png")
    private String avatar;

    @Schema(description = "角色", requiredMode = Schema.RequiredMode.REQUIRED, example = "student")
    private String role;

    @Schema(description = "加入时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2025-01-01T09:00:00")
    private LocalDateTime joinTime;

    @Schema(description = "阅读天数", requiredMode = Schema.RequiredMode.REQUIRED, example = "7")
    private Integer readingDays;

    @Schema(description = "阅读绘本数", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
    private Integer readingBooks;

    @Schema(description = "今日是否已打卡", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
    private Boolean todayPunched;

    /**
     * 转换URL字段
     * 将相对路径转换为完整URL
     */
    @Override
    public void convertUrls() {
        this.avatar = convertUrl(this.avatar);
    }

}
